package net.capgemini.bill.gaty.expressionarithmetique.web.ws.client;

import java.util.List;

import org.springframework.stereotype.Service;

import com.bill.audrey.expressionarithmetique.service.ExpressionArithmetiqueWebService;

//import com.bill.audrey.expressionarithmetique.service.ExpressionArithmetiqueWebService;

 @Service(value="WsClient")
public class WsClient  {
 	private ExpressionArithmetiqueWebService wsinterface;

 
    public String getServiceAdresse() {
		return serviceAdresse;
	}


	public void setServiceAdresse(String serviceAdresse) {
		this.serviceAdresse = serviceAdresse;
	}


	private String serviceAdresse;
	public WsClient() throws AddressCanNotBeNullException {
		super();
		// TODO Auto-generated constructor stub
		 this.wsinterface=WsClientFactory.getClient(serviceAdresse);
	}


	 public WsClient(String serviceAdresse) throws AddressCanNotBeNullException {
		super();
		this.serviceAdresse = serviceAdresse;
		 this.wsinterface=WsClientFactory.getClient(serviceAdresse);
	}


	public WsClient(ExpressionArithmetiqueWebService wsinterface) {
		super();
		this.wsinterface = wsinterface;
	} 


	public String deriver(String expressionArithmetique,
			String variablederivation) {
		// TODO Auto-generated method stub
		 return wsinterface.deriver(expressionArithmetique, variablederivation.charAt(0));
	}


	public Double evaluer(String expressionArithmetique,String variableMap) {
		// TODO Auto-generated method stub
		 return wsinterface.evaluer(expressionArithmetique, variableMap);
	}


	public Boolean valider(String expressionArithmetique) {
		// TODO Auto-generated method stub
		 return wsinterface.valider(expressionArithmetique);
	}


	public String validerAvecException(String expressionArithmetique) {
		// TODO Auto-generated method stub
		 return wsinterface.validerAvecException(expressionArithmetique);
	}


	public List<String> supportedFunctions() {
		// TODO Auto-generated method stub
		 return wsinterface.supportedFunctions();
		
	}  

}
